package com.zysf.library_boot.service.impl;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.zysf.library_boot.dto.BookCommentDto;
import com.zysf.library_boot.dto.MyCommentDto;
import com.zysf.library_boot.entity.BookComment;
import com.zysf.library_boot.service.BookCommentService;
import com.zysf.library_boot.mapper.BookCommentMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author 31161
* @description 针对表【book_comment】的数据库操作Service实现
* @createDate 2024-12-29 01:41:51
*/
@Service
public class BookCommentServiceImpl extends ServiceImpl<BookCommentMapper, BookComment>
    implements BookCommentService{

    @Autowired
    BookCommentMapper bookCommentMapper;

    @Override
    public List<BookCommentDto> showBookComment(Integer bookid,Integer page,Integer size) {
        int offset = (page-1)*size;
        return bookCommentMapper.showBookComment(bookid,offset,size);
    }

    @Override
    public IPage<MyCommentDto> getReaderMyComment(Integer id, Page<MyCommentDto> page) {
        return bookCommentMapper.getMyComment(id,page);
    }
}




